home *** CD-ROM | disk | FTP | other *** search
- #
- # Sample script demonstrating mouse usage.
- # For CD Shell 2.0, May 2004
- #
-
- #--------------------------------------------------------------------------
- # Check for mouse availablity.
- if !$mouse
- then print "\n\nSorry, no mouse was detected.\n\n"
- then end
-
-
- #--------------------------------------------------------------------------
- # Display menu.
-
- set textColor = color[brightgrey on black]
- set boldColor = color[brightcyan on black]
- cls
- set textCursorY = 1
- print c "CD Shell Mouse Interface Sample Script"
- set textCursorX = 0
- set textCursorY = 11
- print " Please select an option:\n"
- print " 1. Toggle mouse visibility\n"
- print " 2. Cycle mouse cursor color\n"
- print " 3. Quit"
-
- menuLoopUpdate: call updateStatus
- menuLoop: mgetkey
-
- if $lastKey == key[1]
- then set mouseVisible = $mouseVisible ^^ 1
- then goto menuLoopUpdate
- if $lastKey == key[2]
- then set mouseColor = $mouseColor + 0x10
- then goto menuLoop
- if $lastKey == key[3]
- then cls
- then end
- if $lastKey == key[mouse]
- then goto menuLoopUpdate
- else goto menuLoop
-
-
- #--------------------------------------------------------------------------
- # Update mouse status information display.
-
- updateStatus:
- set textCursorX = 0
- set textCursorY = 3
- print "Mouse cursor is "
- if $mouseVisible
- then print "visible.\n"
- else print "hidden. \n"
- print "Mouse pointer x position: \cXX$mouseCursorX \n"
- print "Mouse pointer y position: \cXX$mouseCursorY \n"
- print "Mouse left button status: "
- if $mouseButtonLeft
- then print "\cXXPressed \n"
- else print "\cXXNot Pressed\n"
- print "Mouse middle button status: "
- if $mouseButtonMiddle
- then print "\cXXPressed \n"
- else print "\cXXNot Pressed\n"
- print "Mouse right button status: "
- if $mouseButtonRight
- then print "\cXXPressed \n"
- else print "\cXXNot Pressed\n"
- return
-